package net.lab1024.sa.admin.module.business.ai.integration;

import org.springframework.stereotype.Component;

@Component
public class DeepseekErrorCodeHandler implements LlmErrorCodeHandler {
    @Override
    public String getModelType() {
        return "deepseek";
    }

    @Override
    public String getFriendlyMessage(int statusCode, String errorBody) {
        switch (statusCode) {
            case 400: return "请求格式错误，请检查参数格式。";
            case 401: return "API key 错误或认证失败，请检查您的 API key。";
            case 402: return "DeepSeek 账户余额不足，请前往充值页面充值。";
            case 422: return "请求参数错误，请根据提示修改参数。";
            case 429: return "请求过于频繁，请降低请求速率。";
            case 500: return "DeepSeek 服务器内部故障，请稍后重试。";
            case 503: return "DeepSeek 服务器繁忙，请稍后重试。";
            default:
                return "DeepSeek API 调用失败，错误码：" + statusCode + "，请联系管理员。";
        }
    }
} 